{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Embedding\n",
    "\n",
    "    独热码：数据量大 过于稀疏，映射之间是独立的，没有表现出关联性 \n",
    "    Embedding：是一种单词编码方法，用低维向量实现了编码， 这种编码通过神经网络训练优化，能表达出单词间的相关性。\n",
    "    \n",
    "    tf.keras.layers.Embedding(词汇表大小，编码维度) \n",
    "    \n",
    "    编码维度就是用几个数字表达一个单词 对1-100进行编码， [4] 编码为 [0.25, 0.1, 0.11] 例 ：tf.keras.layers.Embedding(100, 3 )\n",
    "    \n",
    "    入Embedding时， x_train维度： [送入样本数， 循环核时间展开步数]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------------load the model-----------------\n",
      "Train on 5 samples\n",
      "Epoch 1/100\n",
      "5/5 [==============================] - 2s 392ms/sample - loss: 0.6222 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 2/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.6139 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 3/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.6058 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 4/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.5978 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 5/100\n",
      "5/5 [==============================] - 0s 13ms/sample - loss: 0.5898 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 6/100\n",
      "5/5 [==============================] - 0s 13ms/sample - loss: 0.5820 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 7/100\n",
      "5/5 [==============================] - 0s 13ms/sample - loss: 0.5744 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 8/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.5668 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 9/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.5594 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 10/100\n",
      "5/5 [==============================] - 0s 14ms/sample - loss: 0.5521 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 11/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.5450 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 12/100\n",
      "5/5 [==============================] - 0s 13ms/sample - loss: 0.5380 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 13/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.5312 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 14/100\n",
      "5/5 [==============================] - 0s 16ms/sample - loss: 0.5245 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 15/100\n",
      "5/5 [==============================] - 0s 16ms/sample - loss: 0.5180 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 16/100\n",
      "5/5 [==============================] - 0s 23ms/sample - loss: 0.5116 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 17/100\n",
      "5/5 [==============================] - 0s 15ms/sample - loss: 0.5053 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 18/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.4992 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 19/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.4932 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 20/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.4873 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 21/100\n",
      "5/5 [==============================] - 0s 34ms/sample - loss: 0.4816 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 22/100\n",
      "5/5 [==============================] - 0s 24ms/sample - loss: 0.4760 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 23/100\n",
      "5/5 [==============================] - 0s 23ms/sample - loss: 0.4705 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 24/100\n",
      "5/5 [==============================] - 0s 24ms/sample - loss: 0.4651 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 25/100\n",
      "5/5 [==============================] - 0s 28ms/sample - loss: 0.4599 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 26/100\n",
      "5/5 [==============================] - 0s 21ms/sample - loss: 0.4547 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 27/100\n",
      "5/5 [==============================] - 0s 13ms/sample - loss: 0.4496 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 28/100\n",
      "5/5 [==============================] - 0s 14ms/sample - loss: 0.4447 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 29/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.4398 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 30/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.4350 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 31/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.4303 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 32/100\n",
      "5/5 [==============================] - 0s 21ms/sample - loss: 0.4257 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 33/100\n",
      "5/5 [==============================] - 0s 16ms/sample - loss: 0.4212 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 34/100\n",
      "5/5 [==============================] - 0s 15ms/sample - loss: 0.4168 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 35/100\n",
      "5/5 [==============================] - 0s 13ms/sample - loss: 0.4124 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 36/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.4081 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 37/100\n",
      "5/5 [==============================] - 0s 22ms/sample - loss: 0.4039 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 38/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.3998 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 39/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.3957 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 40/100\n",
      "5/5 [==============================] - 0s 21ms/sample - loss: 0.3917 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 41/100\n",
      "5/5 [==============================] - 0s 15ms/sample - loss: 0.3878 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 42/100\n",
      "5/5 [==============================] - 0s 14ms/sample - loss: 0.3840 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 43/100\n",
      "5/5 [==============================] - 0s 14ms/sample - loss: 0.3802 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 44/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.3765 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 45/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.3729 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 46/100\n",
      "5/5 [==============================] - 0s 36ms/sample - loss: 0.3693 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 47/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.3658 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 48/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.3624 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 49/100\n",
      "5/5 [==============================] - 0s 30ms/sample - loss: 0.3590 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 50/100\n",
      "5/5 [==============================] - 0s 22ms/sample - loss: 0.3557 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 51/100\n",
      "5/5 [==============================] - 0s 21ms/sample - loss: 0.3524 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 52/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.3492 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 53/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.3461 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 54/100\n",
      "5/5 [==============================] - 0s 35ms/sample - loss: 0.3430 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 55/100\n",
      "5/5 [==============================] - 0s 23ms/sample - loss: 0.3400 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 56/100\n",
      "5/5 [==============================] - 0s 14ms/sample - loss: 0.3370 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 57/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.3341 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 58/100\n",
      "5/5 [==============================] - 0s 12ms/sample - loss: 0.3312 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 59/100\n",
      "5/5 [==============================] - 0s 13ms/sample - loss: 0.3284 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 60/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.3256 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 61/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.3229 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 62/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.3203 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 63/100\n",
      "5/5 [==============================] - 0s 16ms/sample - loss: 0.3176 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 64/100\n",
      "5/5 [==============================] - 0s 14ms/sample - loss: 0.3151 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 65/100\n",
      "5/5 [==============================] - 0s 16ms/sample - loss: 0.3125 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 66/100\n",
      "5/5 [==============================] - 0s 15ms/sample - loss: 0.3100 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 67/100\n",
      "5/5 [==============================] - 0s 23ms/sample - loss: 0.3076 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 68/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.3052 - sparse_categorical_accuracy: 1.0000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 69/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.3028 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 70/100\n",
      "5/5 [==============================] - 0s 21ms/sample - loss: 0.3005 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 71/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.2982 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 72/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.2960 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 73/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.2937 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 74/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.2915 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 75/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.2894 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 76/100\n",
      "5/5 [==============================] - 0s 15ms/sample - loss: 0.2873 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 77/100\n",
      "5/5 [==============================] - 0s 21ms/sample - loss: 0.2852 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 78/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.2831 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 79/100\n",
      "5/5 [==============================] - 0s 15ms/sample - loss: 0.2811 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 80/100\n",
      "5/5 [==============================] - 0s 16ms/sample - loss: 0.2791 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 81/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.2771 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 82/100\n",
      "5/5 [==============================] - 0s 31ms/sample - loss: 0.2752 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 83/100\n",
      "5/5 [==============================] - 0s 22ms/sample - loss: 0.2733 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 84/100\n",
      "5/5 [==============================] - 0s 27ms/sample - loss: 0.2714 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 85/100\n",
      "5/5 [==============================] - 0s 25ms/sample - loss: 0.2695 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 86/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.2677 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 87/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.2658 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 88/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.2640 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 89/100\n",
      "5/5 [==============================] - 0s 30ms/sample - loss: 0.2622 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 90/100\n",
      "5/5 [==============================] - 0s 23ms/sample - loss: 0.2605 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 91/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.2587 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 92/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.2570 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 93/100\n",
      "5/5 [==============================] - 0s 20ms/sample - loss: 0.2553 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 94/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.2536 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 95/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.2519 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 96/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.2502 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 97/100\n",
      "5/5 [==============================] - 0s 18ms/sample - loss: 0.2486 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 98/100\n",
      "5/5 [==============================] - 0s 16ms/sample - loss: 0.2469 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 99/100\n",
      "5/5 [==============================] - 0s 19ms/sample - loss: 0.2453 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 100/100\n",
      "5/5 [==============================] - 0s 17ms/sample - loss: 0.2437 - sparse_categorical_accuracy: 1.0000\n",
      "Model: \"sequential_1\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "embedding_1 (Embedding)      (None, None, 2)           10        \n",
      "_________________________________________________________________\n",
      "simple_rnn_1 (SimpleRNN)     (None, 3)                 18        \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 5)                 20        \n",
      "=================================================================\n",
      "Total params: 48\n",
      "Trainable params: 48\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEICAYAAABYoZ8gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3dd3wUdf748dc7hQRCJ6EldBGkJUCkSzk8D0RFxQJW9BTFruf3LPfz9M7vfdVrKmdF5DwUQU9F8URADgQLLXRCE0MLXZDeUt6/P3bANW6STdzs7Gbez8djH5mdmc/OezafeWfymc/MR1QVY4wx3hHjdgDGGGPCyxK/McZ4jCV+Y4zxGEv8xhjjMZb4jTHGYyzxG2OMx1jiLycR+VREbgz1usZEKzsmood4qR+/iBzxe1sNOAkUOO9vU9WJ4Y/q5xORFsC3wCuqeofb8ZjoUdmOCRHpD7ylqmluxxLJPHXGr6rVT7+ArcDFfvPOVHARiXMvynK5AfgeGC4iCeHcsIjEhnN7JrQq8TFhSuCpxF8c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A3XxkVEgNeBtar6d7/5jfxWuwxYXbRsBcSSJCI1Tk8DFzjbnQrc6Kx2I/BRRcfiZwR+/w678b34Ke57mAoMF5EEEWkBtAYWhTGu4rhWt61el6ry1utwXiH/mVe6L8TX6+Bb4Hdh3nYffP8+rQSWO68LgTeBVc78qUCjMMTSEt9V/BVA9unvAqgH/Bf4xvlZN0zfTTVgH1DLb15Yvhd8B+VOIA/fmc+vS/oegN859Wc9MDicdaiU/XClblu99m69tkc2GGOMx0RLU48xxpgQscRvjDEeY4nfGGM8xhK/McZ4jCV+Y4zxGEv8xhjjMZb4jTHGY/4/S8yYy77PY+UAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "input the number of test alphabet:5\n",
      "input test alphabet:a\n",
      "a->b\n",
      "input test alphabet:d\n",
      "d->e\n",
      "input test alphabet:e\n",
      "e->a\n",
      "input test alphabet:c\n",
      "c->d\n",
      "input test alphabet:e\n",
      "e->a\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "from tensorflow.keras.layers import Dense, SimpleRNN, Embedding\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "\n",
    "input_word = \"abcde\"\n",
    "w_to_id = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4}  # 单词映射到数值id的词典\n",
    "\n",
    "x_train = [w_to_id['a'], w_to_id['b'], w_to_id['c'], w_to_id['d'], w_to_id['e']]\n",
    "y_train = [w_to_id['b'], w_to_id['c'], w_to_id['d'], w_to_id['e'], w_to_id['a']]\n",
    "\n",
    "np.random.seed(7)\n",
    "np.random.shuffle(x_train)\n",
    "np.random.seed(7)\n",
    "np.random.shuffle(y_train)\n",
    "tf.random.set_seed(7)\n",
    "\n",
    "# 使x_train符合Embedding输入要求：[送入样本数， 循环核时间展开步数] ，\n",
    "# 此处整个数据集送入所以送入，送入样本数为len(x_train)；输入1个字母出结果，循环核时间展开步数为1。\n",
    "x_train = np.reshape(x_train, (len(x_train), 1))\n",
    "y_train = np.array(y_train)\n",
    "\n",
    "model = tf.keras.Sequential([\n",
    "    Embedding(5, 2),\n",
    "    SimpleRNN(3),\n",
    "    Dense(5, activation='softmax')\n",
    "])\n",
    "\n",
    "model.compile(optimizer=tf.keras.optimizers.Adam(0.01),\n",
    "              loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False),\n",
    "              metrics=['sparse_categorical_accuracy'])\n",
    "\n",
    "checkpoint_save_path = \"./checkpoint/run_embedding_1pre1.ckpt\"\n",
    "\n",
    "if os.path.exists(checkpoint_save_path + '.index'):\n",
    "    print('-------------load the model-----------------')\n",
    "    model.load_weights(checkpoint_save_path)\n",
    "\n",
    "cp_callback = tf.keras.callbacks.ModelCheckpoint(filepath=checkpoint_save_path,\n",
    "                                                 save_weights_only=True,\n",
    "                                                 save_best_only=True,\n",
    "                                                 monitor='loss')  # 由于fit没有给出测试集，不计算测试集准确率，根据loss，保存最优模型\n",
    "\n",
    "history = model.fit(x_train, y_train, batch_size=32, epochs=100, callbacks=[cp_callback])\n",
    "\n",
    "model.summary()\n",
    "\n",
    "# print(model.trainable_variables)\n",
    "file = open('./weights.txt', 'w')  # 参数提取\n",
    "for v in model.trainable_variables:\n",
    "    file.write(str(v.name) + '\\n')\n",
    "    file.write(str(v.shape) + '\\n')\n",
    "    file.write(str(v.numpy()) + '\\n')\n",
    "file.close()\n",
    "\n",
    "###############################################    show   ###############################################\n",
    "\n",
    "# 显示训练集和验证集的acc和loss曲线\n",
    "acc = history.history['sparse_categorical_accuracy']\n",
    "loss = history.history['loss']\n",
    "\n",
    "plt.subplot(1, 2, 1)\n",
    "plt.plot(acc, label='Training Accuracy')\n",
    "plt.title('Training Accuracy')\n",
    "plt.legend()\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "plt.plot(loss, label='Training Loss')\n",
    "plt.title('Training Loss')\n",
    "plt.legend()\n",
    "plt.show()\n",
    "\n",
    "############### predict #############\n",
    "\n",
    "preNum = int(input(\"input the number of test alphabet:\"))\n",
    "for i in range(preNum):\n",
    "    alphabet1 = input(\"input test alphabet:\")\n",
    "    alphabet = [w_to_id[alphabet1]]\n",
    "    # 使alphabet符合Embedding输入要求：[送入样本数， 循环核时间展开步数]。\n",
    "    # 此处验证效果送入了1个样本，送入样本数为1；输入1个字母出结果，循环核时间展开步数为1。\n",
    "    alphabet = np.reshape(alphabet, (1, 1))\n",
    "    result = model.predict(alphabet)\n",
    "    pred = tf.argmax(result, axis=1)\n",
    "    pred = int(pred)\n",
    "    tf.print(alphabet1 + '->' + input_word[pred])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-------------load the model-----------------\n",
      "Train on 22 samples\n",
      "Epoch 1/100\n",
      "22/22 [==============================] - 2s 95ms/sample - loss: 0.0176 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 2/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0175 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 3/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0174 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 4/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0173 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 5/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0172 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 6/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0171 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 7/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0170 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 8/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0169 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 9/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0168 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 10/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0167 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 11/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0166 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 12/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0165 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 13/100\n",
      "22/22 [==============================] - 0s 6ms/sample - loss: 0.0164 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 14/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0163 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 15/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0162 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 16/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0161 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 17/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0161 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 18/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0160 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 19/100\n",
      "22/22 [==============================] - 0s 6ms/sample - loss: 0.0159 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 20/100\n",
      "22/22 [==============================] - 0s 6ms/sample - loss: 0.0158 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 21/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0157 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 22/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0156 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 23/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0155 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 24/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0154 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 25/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0153 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 26/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0153 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 27/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0152 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 28/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0151 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 29/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0150 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 30/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0149 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 31/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0148 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 32/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0148 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 33/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0147 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 34/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0146 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 35/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0145 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 36/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0144 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 37/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0144 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 38/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0143 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 39/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0142 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 40/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0141 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 41/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0141 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 42/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0140 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 43/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0139 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 44/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0138 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 45/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0138 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 46/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0137 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 47/100\n",
      "22/22 [==============================] - 0s 7ms/sample - loss: 0.0136 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 48/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0136 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 49/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0135 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 50/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0134 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 51/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0133 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 52/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0133 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 53/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0132 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 54/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0131 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 55/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0131 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 56/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0130 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 57/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0129 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 58/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0129 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 59/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0128 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 60/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0128 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 61/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0127 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 62/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0126 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 63/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0126 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 64/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0125 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 65/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0124 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 66/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0124 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 67/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0123 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 68/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0123 - sparse_categorical_accuracy: 1.0000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 69/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0122 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 70/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0121 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 71/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0121 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 72/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0120 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 73/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0120 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 74/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0119 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 75/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0119 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 76/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0118 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 77/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0117 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 78/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0117 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 79/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0116 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 80/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0116 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 81/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0115 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 82/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0115 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 83/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0114 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 84/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0114 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 85/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0113 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 86/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0113 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 87/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0112 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 88/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0112 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 89/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0111 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 90/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0111 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 91/100\n",
      "22/22 [==============================] - 0s 7ms/sample - loss: 0.0110 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 92/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0110 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 93/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0109 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 94/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0109 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 95/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0108 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 96/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0108 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 97/100\n",
      "22/22 [==============================] - 0s 4ms/sample - loss: 0.0107 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 98/100\n",
      "22/22 [==============================] - 0s 3ms/sample - loss: 0.0107 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 99/100\n",
      "22/22 [==============================] - 0s 6ms/sample - loss: 0.0106 - sparse_categorical_accuracy: 1.0000\n",
      "Epoch 100/100\n",
      "22/22 [==============================] - 0s 5ms/sample - loss: 0.0106 - sparse_categorical_accuracy: 1.0000\n",
      "Model: \"sequential_5\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "embedding_5 (Embedding)      (None, None, 2)           52        \n",
      "_________________________________________________________________\n",
      "simple_rnn_5 (SimpleRNN)     (None, 10)                130       \n",
      "_________________________________________________________________\n",
      "dense_5 (Dense)              (None, 26)                286       \n",
      "=================================================================\n",
      "Total params: 468\n",
      "Trainable params: 468\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEICAYAAABYoZ8gAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nO3deXhU1fnA8e9LhiSybxGQCUsIhj0BEkBBBW0FV1wRXBBBEaSutWq1VlpbpbbVSlFcKT8UE3eLFYKiLNWCIaxCWIIESQKySgAxBpLz+2MuOA4zySSZzJ3l/TxPHmbuPffe9w73vjk5c+45YoxBKaVU9KhndwBKKaWCSxO/UkpFGU38SikVZTTxK6VUlNHEr5RSUUYTv1JKRRlN/DUkIvNF5OZAl1UqXOk9ET4kmvrxi8gRt7cNgB+Bcuv97caYOcGPqvZEpBPwNfCCMeYOu+NR4SPS7gkRGQK8boxx2h1LKIuqGr8xptGJH2AHcJnb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KhMS15AXtsel17V3kXxdh0viLwIS3d47gZ3BDEBE6uO6OeYYY94DMMbsNsaUG2MqgJcJUtOBMWan9e8e4H3ruLtFpK0Va1tgTzBisVwErDLG7LbisuVzsfj6HGy/hnywNS69risVsdd1uCT+FUAXEelk/RYeBcwN1sFFRIBXgY3GmKfdlrd1K3YlsN5z2zqIpaGIND7xGrjQOu5c4Gar2M3Av+s6Fjejcftz2I7PxY2vz2EuMEpE4kSkE9AFyAliXL7Ydm3rdV2lyL2ug/kNeS2/6b4YV6+Dr4FHgnzswbj+fFoHrLF+LgZeA76yls8F2gYhliRc3+KvBTac+CyAlsCnQL71b4sgfTYNgP1AU7dlQflccN2Uu4BjuGo+4yv7HIBHrOtnM3BRMK+hKs7Dlmtbr+vova51yAallIoy4dLUo5RSKkA08SulVJTRxK+UUlFGE79SSkUZTfxKKRVlNPErpVSU0cSvlFJR5v8Bl1odud/5zMEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "input the number of test alphabet:5\n",
      "input test alphabet:abcd\n",
      "abcd->e\n",
      "input test alphabet:hijk\n",
      "hijk->l\n",
      "input test alphabet:mnop\n",
      "mnop->q\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "from tensorflow.keras.layers import Dense, SimpleRNN, Embedding\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "\n",
    "input_word = \"abcdefghijklmnopqrstuvwxyz\"\n",
    "w_to_id = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4,\n",
    "           'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9,\n",
    "           'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14,\n",
    "           'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19,\n",
    "           'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}  # 单词映射到数值id的词典\n",
    "\n",
    "training_set_scaled = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,\n",
    "                       11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n",
    "                       21, 22, 23, 24, 25]\n",
    "\n",
    "x_train = []\n",
    "y_train = []\n",
    "\n",
    "for i in range(4, 26):\n",
    "    x_train.append(training_set_scaled[i - 4:i])\n",
    "    y_train.append(training_set_scaled[i])\n",
    "\n",
    "np.random.seed(7)\n",
    "np.random.shuffle(x_train)\n",
    "np.random.seed(7)\n",
    "np.random.shuffle(y_train)\n",
    "tf.random.set_seed(7)\n",
    "\n",
    "# 使x_train符合Embedding输入要求：[送入样本数， 循环核时间展开步数] ，\n",
    "# 此处整个数据集送入所以送入，送入样本数为len(x_train)；输入4个字母出结果，循环核时间展开步数为4。\n",
    "x_train = np.reshape(x_train, (len(x_train), 4))\n",
    "y_train = np.array(y_train)\n",
    "\n",
    "model = tf.keras.Sequential([\n",
    "    Embedding(26, 2),\n",
    "    SimpleRNN(10),\n",
    "    Dense(26, activation='softmax')\n",
    "])\n",
    "\n",
    "model.compile(optimizer=tf.keras.optimizers.Adam(0.01),\n",
    "              loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False),\n",
    "              metrics=['sparse_categorical_accuracy'])\n",
    "\n",
    "checkpoint_save_path = \"./checkpoint/rnn_embedding_4pre1.ckpt\"\n",
    "\n",
    "if os.path.exists(checkpoint_save_path + '.index'):\n",
    "    print('-------------load the model-----------------')\n",
    "    model.load_weights(checkpoint_save_path)\n",
    "\n",
    "cp_callback = tf.keras.callbacks.ModelCheckpoint(filepath=checkpoint_save_path,\n",
    "                                                 save_weights_only=True,\n",
    "                                                 save_best_only=True,\n",
    "                                                 monitor='loss')  # 由于fit没有给出测试集，不计算测试集准确率，根据loss，保存最优模型\n",
    "\n",
    "history = model.fit(x_train, y_train, batch_size=32, epochs=100, callbacks=[cp_callback])\n",
    "\n",
    "model.summary()\n",
    "\n",
    "file = open('./weights.txt', 'w')  # 参数提取\n",
    "for v in model.trainable_variables:\n",
    "    file.write(str(v.name) + '\\n')\n",
    "    file.write(str(v.shape) + '\\n')\n",
    "    file.write(str(v.numpy()) + '\\n')\n",
    "file.close()\n",
    "\n",
    "###############################################    show   ###############################################\n",
    "\n",
    "# 显示训练集和验证集的acc和loss曲线\n",
    "acc = history.history['sparse_categorical_accuracy']\n",
    "loss = history.history['loss']\n",
    "\n",
    "plt.subplot(1, 2, 1)\n",
    "plt.plot(acc, label='Training Accuracy')\n",
    "plt.title('Training Accuracy')\n",
    "plt.legend()\n",
    "\n",
    "plt.subplot(1, 2, 2)\n",
    "plt.plot(loss, label='Training Loss')\n",
    "plt.title('Training Loss')\n",
    "plt.legend()\n",
    "plt.show()\n",
    "\n",
    "################# predict ##################\n",
    "\n",
    "preNum = int(input(\"input the number of test alphabet:\"))\n",
    "for i in range(preNum):\n",
    "    alphabet1 = input(\"input test alphabet:\")\n",
    "    alphabet = [w_to_id[a] for a in alphabet1]\n",
    "    # 使alphabet符合Embedding输入要求：[送入样本数， 时间展开步数]。\n",
    "    # 此处验证效果送入了1个样本，送入样本数为1；输入4个字母出结果，循环核时间展开步数为4。\n",
    "    alphabet = np.reshape(alphabet, (1, 4))\n",
    "    result = model.predict([alphabet])\n",
    "    pred = tf.argmax(result, axis=1)\n",
    "    pred = int(pred)\n",
    "    tf.print(alphabet1 + '->' + input_word[pred])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
